<% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view views default.css))) %>
<% watermark  = File.expand_path(File.join(Redcar.root, %w(plugins html_view views watermark-48.png))) %>
<link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">

<div id="top">
  <img src="file://<%=watermark%>" id="watermark"/>
  <h3>Command History</h3>
  <a href="controller/index">Refresh</a>
</div>
<div class="main">
  <table>
    <tr>
      <th>Completed</th>
      <th>Description</th>
    </tr>
    <% Redcar.app.history.reverse.each do |command| %>
      <tr class="<%= "error" if command.error %>">
        <td><%#= command.completed_time.strftime("%X") %></td>
        <td><%= CGI.escapeHTML(command.class.to_s) %></td>
      </tr>
      <% if e = command.error %>
        <tr>
          <td colspan="3">
            <strong><%= e.class %></strong>
            <%= CGI.escapeHTML(e.message) %>
            <br /><br />
            <% e.backtrace.each do |line| %>
              <%= line %><br />
            <% end %>
          </td>
        </tr>
      <% end %>
    <% end %>
  </table>
</div>

